package com.wjy.common.thread.create;

import com.wjy.common.thread.param.ThreadParams;

import java.util.concurrent.ThreadFactory;

/**
 * @author ybxxszl
 * @desc 线程工厂创建
 * @date 2019/5/4
 */
public class ThreadFactoryCreate implements ThreadFactory {

    @Override
    public Thread newThread(Runnable r) {

        ThreadGroup group = new ThreadGroup(ThreadParams.THREADGROUPNAME + ThreadParams.getThreadGroupNum());
        Thread thread = new Thread(group, r, ThreadParams.THREADNAME + ThreadParams.getThreadNum());

        return thread;

    }

}
